<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
    echo heading("Depositar",4,"class='divisor'");		
        $id = $this->uri->segment(3);
        $query = $this->ContaModel->getIdConta($id)->row();
	$id_conta = $query->id_conta;
	$descricao = $query->descricao;
        
        $saldo2 = $this->ContaModel->getSaldo($id)->row();
	$saldo = $saldo2->saldo;
        $saldo3 = number_format($saldo,2,',','.');
	
    			
    $atributos_formulario = array('class' => 'form-signin', 'id'=>'formcadastro');
    echo form_open ("contaController/chamarTelaDepositarConta/$id",$atributos_formulario);
    if(validation_errors())
    { echo '<div class="alert alert-danger">
        	<button type="button" class="close " data-dismiss="alert">&times;</button>
                <span>'.validation_errors().'</span>
          	</div>';
    }
    if($this->session->flashdata('cadastrook')):
	echo "<div class=alerta>";
        echo "<p class='validacoes'>".$this->session->flashdata('cadastrook')."</p>";
	echo "</div>";
    endif;
    echo form_label('Conta para depósito::','conta');
    echo form_input(array('name'=>'conta_credora', 'type'=>'hidden'),  set_value('conta_credora',$id_conta));
    echo form_input(array('name'=>''),  set_value('descricaoContaPai',$descricao.' ['.$saldo3.']') ,'disabled="disabled"');
    echo form_label('Valor R$ ::','conta');
    echo form_input(array('name'=>'valor','class'=>'input-small moeda','placeholder'=>'Valor '),  set_value('valor'),'autofocus');
    echo br();
    echo form_label('Data ::');
    echo '<div id="datetimepicker" class="input-append date datetimepicker">';
    echo form_input(array('name'=>'data_transacao','id'=>'data_transacao','class'=>'input-xsmall date ','placeholder'=>'Data','value' => date('d/m/Y')),  set_value('data_transacao'),'autofocus');
    echo '<span class="add-on">
          <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
          </span>
          </div>';
    echo br();
    echo form_label('Descrição ::');
            $data = array(      'name'        => 'descricao',
                                'id'          => 'descricao',
                                'value'       => '',
                                'rows'        => '4',
                                'cols'        => '30',
                                'class'       =>'textarea',
                                'placeholder' => 'Descreva observação',
                                'maxlength'    => '50',     
                               
                             );
    echo form_textarea($data, set_value('descricao'));
    echo br();
    $btnGravar = array(     'name' => 'button',
                            'id' => 'button',
                            'value' => 'true',
                            'type' => 'submit',
                            'content' => 'Gravar',
                            'class' => 'btn btn-primary'
                        );
   echo form_button($btnGravar);
   echo nbs(4);                                
   $btnLimpar = array('name' => 'button', 'id' => 'button', 'value' => 'true', 'type' => 'reset', 'content' => 'Limpar', 'class' => 'btn btn-primary');
   echo form_button($btnLimpar);
   echo nbs(4);
   echo anchor("PrincipalController/",' Voltar ', array('title' =>'Voltar para principal', 'class' => 'btn btn btn-danger'));
   echo form_close();
  ?>
			  		    